﻿using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;

namespace Framework.Data.Core
{
    public class SqlExpressionField : BaseField, ISqlExpressionField
    {

        #region "Membres"
        #endregion
        protected string _sqlExpression = null;


        #region "Constructeurs"

        /// <summary>
        /// Constructeur
        /// </summary>
        /// <param name="entity">Entité auquel ce champ appartient</param>
        /// <param name="name">Nom du champ</param>
        /// <param name="sqlExpression">Expression Sql qui fera partie du select</param>
        /// <param name="fieldValueType">Type du champ</param>
        /// <remarks></remarks>
        public SqlExpressionField(IBaseEntity entity, string name, string sqlExpression, System.Type fieldValueType)
            : this(entity, name, sqlExpression, fieldValueType, true)
        {
        }

        /// <summary>
        /// Constructeur
        /// </summary>
        /// <param name="entity">Entité auquel ce champ appartient</param>
        /// <param name="name">Nom du champ</param>
        /// <param name="sqlExpression">Expression Sql qui fera partie du select</param>
        /// <param name="fieldValueType">Type du champ</param>
        /// <param name="displayFieldInList">Indique si le champ doit être affiché dans les listes</param>
        /// <remarks></remarks>
        public SqlExpressionField(IBaseEntity entity, string name, string sqlExpression, System.Type fieldValueType, bool displayFieldInList)
            : base(entity, name, fieldValueType, false, displayFieldInList)
        {
            this._sqlExpression = sqlExpression;
        }

        #endregion

        #region "ISqlExpressionField"

        public string SqlExpression
        {
            get { return this._sqlExpression; }
            set { this._sqlExpression = value; }
        }
        #endregion
    }
}